/*
 * PlotCtrlPane.h
 */

#ifndef PLOTCTRLPANE_H_
#define PLOTCTRLPANE_H_

#include <wx/wx.h>
#include <wx/plotctrl/plotctrl.h>
#include "GeoData.h"

///Macro returns max of a and b
#define MAX(a,b) (((a)>(b))?(a):(b))

///PlotCtrl class from wxWidgets is used for Semi-variogram
class PlotCtrlPane : public wxPlotCtrl {

	double sill, range;
	wxPlotData *xdir, *ydir;
	int iIndex, numMax;
	int revxscale, revyscale;

public:
	PlotCtrlPane(wxPanel* parent,
	           wxWindowID win_id = wxID_ANY,
	           const wxPoint &pos = wxDefaultPosition,
	           const wxSize &size = wxDefaultSize,
	           wxPlotCtrlAxis_Type flags = wxPLOTCTRL_DEFAULT,
	           const wxString& name = wxT("wxPlotCtrl"));

	virtual ~PlotCtrlPane();
	void plotData(double *xsemis, double *ysemis, int x, int y, double deltax, double deltay);
	void RedrawData();
	void plotModel1(void);
	void plotModel2(void);
	void plotModel3(void);
	void ClearPoint(void);
	bool deleteExisting( wxString string );
	void OnPoint( wxPlotCtrlEvent& event );
	void SetRange( wxString r );
	void SetSill( wxString s );
	double getRange() { return range; }
	double getSill() { return sill; };
	void ScaleX(wxString scale);
	void ScaleY(wxString scale);

	DECLARE_EVENT_TABLE()

};

#endif /* PLOTCTRLPANE_H_ */
